package com.magiccompass.alipay.barcode.zdummy;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.magiccompass.alipay.barcode.model.DailySettlementRecordModel;
import com.magiccompass.alipay.barcode.util.DailySettlementFileHandler;

public class SettlementFileTest {
	public static void main(String[] args) 
    {
        //Create the application context
        //ApplicationContext context = new FileSystemXmlApplicationContext("D:/workspace/alipay_barcode_mc/alipay_barcode_mc/WebContent/WEB-INF/applicationContext.xml");
         
        DailySettlementFileHandler dsfh = DailySettlementFileHandler.getInstance();
        
        DailySettlementRecordModel dsr = new DailySettlementRecordModel();
        List<DailySettlementRecordModel> dailySettlementRecordsAdmin = new ArrayList<DailySettlementRecordModel>();
        dsr.setSettlementAmount(new BigDecimal(100.00));
        dsr.setMerchantId(1);
        dsr.setMtId(1);
        dsr.setStatus("S");
        dsr.setCollectionAmount(new BigDecimal(100.00));
        dsr.setTransactionTime("2016-04-02 12:00:00");
        dailySettlementRecordsAdmin.add(dsr);
        
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(0.00));
        dsr.setMerchantId(1);
        dsr.setMtId(2);
        dsr.setStatus("C");
        dsr.setCollectionAmount(new BigDecimal(100.00));
        dsr.setTransactionTime("2016-04-02 12:00:01");
        dailySettlementRecordsAdmin.add(dsr);
        
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(-50.00));
        dsr.setMerchantId(1);
        dsr.setMtId(3);
        dsr.setStatus("E");
        dsr.setCollectionAmount(new BigDecimal(50.00));
        dsr.setTransactionTime("2016-04-02 12:00:02");
        dailySettlementRecordsAdmin.add(dsr);
        
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(-50.00));
        dsr.setMerchantId(2);
        dsr.setMtId(4);
        dsr.setStatus("E");
        dsr.setCollectionAmount(new BigDecimal(50.00));
        dsr.setTransactionTime("2016-04-02 12:00:02");
        dailySettlementRecordsAdmin.add(dsr);
        
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(20.00));
        dsr.setMerchantId(2);
        dsr.setMtId(5);
        dsr.setStatus("S");
        dsr.setCollectionAmount(new BigDecimal(20.00));
        dsr.setTransactionTime("2016-04-02 12:00:02");
        dailySettlementRecordsAdmin.add(dsr);
        
        dsfh.setDailySettlementRecordsAdmin(dailySettlementRecordsAdmin);
        
        List<DailySettlementRecordModel> dailySettlementRecordsSingleMerchant = new ArrayList<DailySettlementRecordModel>();
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(100.00));
        dsr.setMerchantId(1);
        dsr.setMtId(1);
        dsr.setStatus("S");
        dsr.setCollectionAmount(new BigDecimal(100.00));
        dsr.setTransactionTime("2016-04-02 12:00:00");
        dailySettlementRecordsSingleMerchant.add(dsr);
        
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(0.00));
        dsr.setMerchantId(1);
        dsr.setMtId(2);
        dsr.setStatus("C");
        dsr.setCollectionAmount(new BigDecimal(100.00));
        dsr.setTransactionTime("2016-04-02 12:00:01");
        dailySettlementRecordsSingleMerchant.add(dsr);
        
        dsr = new DailySettlementRecordModel();
        dsr.setSettlementAmount(new BigDecimal(-50.00));
        dsr.setMerchantId(1);
        dsr.setMtId(3);
        dsr.setStatus("E");
        dsr.setCollectionAmount(new BigDecimal(50.00));
        dsr.setTransactionTime("2016-04-02 12:00:02");
        dailySettlementRecordsSingleMerchant.add(dsr);
        
        dsfh.setDailySettlementRecordsSingleMerchant(dailySettlementRecordsSingleMerchant);
        
       // dsfh.dummyMakeDailySettlementFileTest();
    }
}